/*
 * @Author: your name
 * @Date: 2021-05-21 10:22:05
 * @LastEditTime: 2021-09-06 11:35:32
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \central-system\src\modules\UnifiedAuthentication\UnifiedLogin\api.js
 */

import request from '@/utils/request'
import Qs from 'qs'
export function getSMSCaptcha(data) {
    return request({
        url: '/sys-auth/oauth/sms_captcha',
        params: data,
        method: 'get'
    })
}
export function getImgCaptcha() {
    return request({
        url: '/sys-auth/oauth/img_captcha',
        params: {
            height: 43,
            width: 110,
            len: 4
        },
        method: 'get'
    })
}
export function getToken(data) {
    return request({
        url: '/sys-sso/oauth2/login',
        method: 'post',
        data: {
            scope: 'all',
            ...data
        },
        transformRequest: [function (data) {
            data = Qs.stringify(data) //序列化参数
            return data
        }]
    })
}